home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 July
/
Ahoy_Magazine_87-07_1987_Double_L_Side_A.d64
/
Opt. Oscillator
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
694b
|
20 lines
0 rem << rr43-3 >>
1 rem =================================
2 print"[147] [207]ptical [207]scillator"
3 rem rupert report #43
4 rem -------c64 and c128------
5 rem > drive led from motor output
6 rem (pin c-3) of cassette port.
7 rem > read cadmium sulphide photocell
8 rem from button a input (pin 6) of
9 rem joystick control port 2.
10 rem =================================
20 poke 0,peek(0) or 2^4 :rem set ddr so bit 4 of address 1 is an output.
30 poke 1,peek(1) and not 2^4 :rem clear bit 4 of address 1
40 poke 192,1:rem set $192 to keep motor off
50 l1=peek(1) and not 2^5 :rem led on
60 l0=peek(1) or 2^5 :rem led off
70 if (peek(56320) and 16)=16 then poke 1,l1 :print "on",
80 if (peek(56320) and 16)= 0 then poke 1,l0 :print "off",
90 goto 70